:root {
  --bg: #fcf7ff;
  --bg-elev: #f1f3f4;
  --bg-active: #ffffff;
  --fg: #202124;
  --fg-muted: #5f6368;
  --accent: #1a73e8;
  --border: #dadce0;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
  user-select: none;
}

.titlebar-drag-region {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 28px;
  -webkit-app-region: drag;
}

#top-ui {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: var(--bg);
  -webkit-app-region: drag;
  border-bottom: 1px solid #e8e4f1;
  padding-bottom: 5px;
}

#tab-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #dfddee;
  padding: 0px 140px 0 72px;
  -webkit-app-region: drag;
}

/* Windows 窗口控制 */
.window-controls {
  position: absolute;
  top: 0;
  right: 0;
  height: 30px;
  display: none;
  -webkit-app-region: no-drag;
  align-items: center;
}

.win-btn {
  width: 46px;
  height: 30px;
  border: none;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  -webkit-app-region: no-drag;
  display: flex;
  align-items: center;
  justify-content: center;
}

.win-btn:hover { background: rgba(0,0,0,0.06); }
.win-close:hover { background: #e81123; color: #ffffff; }

.win-btn svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
}

.win-close:hover svg {
  stroke: #ffffff;
}

.tabs {
  flex: 1;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.tab {
  min-width: 120px;
  max-width: 220px;
  height: 36px;
  background: var(--bg-elev);
  border-bottom: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  cursor: pointer;
}

.tab.active {
  background: var(--bg-active);
}

.tab .favicon {
  width: 16px;
  height: 16px;
}

.tab .title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--fg);
  font-size: 14px;
}

.tab .close {
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
}

.tab .close:hover {
  background: rgba(0,0,0,0.06);
  color: var(--fg);
}

.new-tab, .tab, .tab .close { -webkit-app-region: no-drag; }

/* .new-tab {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--fg);
  cursor: pointer;
  -webkit-app-region: no-drag;
} */

#toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 0;
  -webkit-app-region: no-drag;
  padding: 0 10px;
}

.nav-buttons button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid #e5e7eb;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  -webkit-app-region: no-drag;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-buttons button:hover {
  background: #f3f4f6;
}

.nav-buttons button:disabled {
  opacity: 0.45;
}

.nav-buttons button svg {
  width: 16px;
  height: 16px;
  stroke: #6b7280; /* default icon color */
}

.nav-buttons button:hover svg {
  stroke: #111827;
}

.nav-buttons button:disabled svg {
  stroke: #c7c9ce;
}

.nav-buttons button:disabled {
  opacity: 0.4;
  cursor: default;
}

#address-bar {
  flex: 1;
  height: 30px;
  border-radius: 9999px;
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
  color: #4b5563;
  padding: 0 12px 0 38px;
  outline: none;
  -webkit-app-region: no-drag;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%239ca3af" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="2" y1="12" x2="22" y2="12"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/></svg>');
  background-repeat: no-repeat;
  background-position: 12px center;
  background-size: 16px 16px;
}

#address-bar:disabled {
  color: #9ca3af;
}

#address-bar::placeholder {
  color: var(--fg-muted);
}

.primary {
  height: 30px;
  padding: 0 14px;
  border: none;
  border-radius: 8px;
  background: #635bff;
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  -webkit-app-region: no-drag;
}

.primary:hover {
  background: #574fff;
}

.new-tab {
  position: relative;
}

/* .new-tab::before,
.new-tab::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transform: translate(-50%, -50%);
} */

.new-tab::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.icon-button {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #374151;
  cursor: pointer;
  -webkit-app-region: no-drag;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.icon-button:hover {
  background: #f9fafb;
}

.icon-button svg {
  width: 16px;
  height: 16px;
  stroke: #6b7280;
}

.icon-button:hover svg {
  stroke: #111827;
}
